package com.byx.chatclient.entity;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

/**
 * MessagePo
 * 可以保存到数据库的消息类型
 * @author Superb
 * @date 2021/4/5 10:12
 */
@Entity
public class MessagePo {
    @Id
    private String id;
    private String senderId;
    private String recipientId;
    private Integer type;
    private Integer contentType;
    private String content;
    private Long sendTimestamp;
    private Integer status;
    @Generated(hash = 36229836)
    public MessagePo(String id, String senderId, String recipientId, Integer type,
            Integer contentType, String content, Long sendTimestamp,
            Integer status) {
        this.id = id;
        this.senderId = senderId;
        this.recipientId = recipientId;
        this.type = type;
        this.contentType = contentType;
        this.content = content;
        this.sendTimestamp = sendTimestamp;
        this.status = status;
    }
    @Generated(hash = 297243290)
    public MessagePo() {
    }
    public String getId() {
        return this.id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getSenderId() {
        return this.senderId;
    }
    public void setSenderId(String senderId) {
        this.senderId = senderId;
    }
    public String getRecipientId() {
        return this.recipientId;
    }
    public void setRecipientId(String recipientId) {
        this.recipientId = recipientId;
    }
    public Integer getType() {
        return this.type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public Integer getContentType() {
        return this.contentType;
    }
    public void setContentType(Integer contentType) {
        this.contentType = contentType;
    }
    public String getContent() {
        return this.content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public Long getSendTimestamp() {
        return this.sendTimestamp;
    }
    public void setSendTimestamp(Long sendTimestamp) {
        this.sendTimestamp = sendTimestamp;
    }
    public Integer getStatus() {
        return this.status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }


    public static final class Builder {
        private String id;
        private String senderId;
        private String recipientId;
        private Integer type;
        private Integer contentType;
        private String content;
        private Long sendTimestamp;
        private Integer status;

        public Builder() {
        }

        public static Builder aMessagePo() {
            return new Builder();
        }

        public Builder withId(String id) {
            this.id = id;
            return this;
        }

        public Builder withSenderId(String senderId) {
            this.senderId = senderId;
            return this;
        }

        public Builder withRecipientId(String recipientId) {
            this.recipientId = recipientId;
            return this;
        }

        public Builder withType(Integer type) {
            this.type = type;
            return this;
        }

        public Builder withContentType(Integer contentType) {
            this.contentType = contentType;
            return this;
        }

        public Builder withContent(String content) {
            this.content = content;
            return this;
        }

        public Builder withSendTimestamp(Long sendTimestamp) {
            this.sendTimestamp = sendTimestamp;
            return this;
        }

        public Builder withStatus(Integer status) {
            this.status = status;
            return this;
        }

        public MessagePo build() {
            MessagePo messagePo = new MessagePo();
            messagePo.setId(id);
            messagePo.setSenderId(senderId);
            messagePo.setRecipientId(recipientId);
            messagePo.setType(type);
            messagePo.setContentType(contentType);
            messagePo.setContent(content);
            messagePo.setSendTimestamp(sendTimestamp);
            messagePo.setStatus(status);
            return messagePo;
        }
    }
}
